package gui;

import java.io.IOException;
import java.text.ParseException;

import main.Control;
import main.ControlInterface;

public class Observer {
	static ControlInterface ci;
	static Observer onlyOne;
	private int currTab;

	public static Observer getInstance() {
		if (onlyOne == null) {
			onlyOne = new Observer();
		}
		return onlyOne;
	}

	private Observer() {
		try {
			ci = Control.getInstance();
		} catch (ParseException | IOException e) {
		}
	}

	protected void passToControl(String input) {
		try {
			ci.processInput(input);
		} catch (ParseException | IOException e) {
		}
	}

	protected void changeCurrentPanel(int panelIndex) {
		currTab = panelIndex;
		ci.changeCurrentPanel(panelIndex);
	}

	protected int getCurrTab() {
		return currTab;
	}
}
